package com.sg.business.commons.operation.handler.vault;

import com.mongodb.BasicDBObject;
import com.mongodb.DBObject;
import com.sg.business.model.Document;
import com.sg.widgets.part.CurrentAccountContext;

public class SetDocumentManagementProperty extends AbstractOpenDocumentHandler {

	@Override
	protected String getEditorId() {
		return "vault.document.management";
	}

	@Override
	protected void updateDocumentWithData(Document document, DBObject data) throws Exception {
		Object sec = data.get(Document.F_SECURITY);
		Object owner = data.get(Document.F_OWNER);
		document.doModifyManagementProperty(new BasicDBObject().append(
				Document.F_SECURITY, sec).append(
				Document.F_OWNER, owner),new CurrentAccountContext());
	}

}
